package com.yc.backstage.controller;

import com.yc.backstage.entity.SysDept;
import com.yc.backstage.service.SysDeptService;
import com.yc.common.res.ResultClass;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* @Classname SysDeptController
* @Description
* @Version 1.0.0
* @Date 2022-08-23 11:49:19
* @Created by Mikechen
*/
@RestController
@RequestMapping("/backstage/sysDept")
public class SysDeptController {
    @Autowired
    private SysDeptService sysDeptService;
    /**
     * 获取部门下拉树列表
     */
    @GetMapping("/treeselect")
    public ResultClass treeselect() {
        List<SysDept> depts = sysDeptService.selectDeptList();
        return ResultClass.success(sysDeptService.buildDeptTreeSelect(depts));
    }
}
